package seminarski.gui;


import java.awt.FlowLayout;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;


public class App extends JFrame{
	private static final long serialVersionUID = 1L;
	private static App instance;
	
	MyCanvas canvas; 
	private Toolbar toolbar;
//	private StatusBar statusbar;
	
	private App(){
		super("Marija Prokopijevic 18/08");
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {

		} catch (InstantiationException e) {
			
		} catch (IllegalAccessException e) {
			
		} catch (UnsupportedLookAndFeelException e) {
			
		}
		initVariables();
		
		this.setSize(800, 600);
		this.setLayout(new FlowLayout());
		this.setLocationRelativeTo(null);
		this.setResizable(false);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setVisible(true);

	}

	
	private void initVariables() {
		canvas = new MyCanvas(550, 550);
		toolbar = new Toolbar(200, 250);
//		statusbar = new StatusBar();
		
		this.add(canvas);
		this.add(toolbar);
//		this.add(statusbar);
		
	}


	public static App getApp(){
		if(instance == null)
		{
			instance = new App();
		}
		return instance;
	}


	public MyCanvas getCanvas() {
		return canvas;
	}


	public Toolbar getToolbar() {
		return toolbar;
	}


//	public StatusBar getStatusBar() {
//		return statusbar;
//	}
}
